﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Yaml.Presentation.Parsing.TokenScanners {
    class DocumentEndTokenScanner : DocumentTokenScanner {

        public DocumentEndTokenScanner(Scanner scanner)
            : base(scanner) {
        }

        protected override bool CheckForToken() {
            return (Scanner.State.Column == 0 &&
                Reader.Prefix(3) == "...");
        }

        protected override void ScanForToken() {
            base.ScanForToken();
            Scanner.SkipComment();
        }

        protected override Yaml.Presentation.Tokens.Token CreateToken() {
            return new Tokens.DocumentEndToken(Start, End);
        }
    }
}
